package com.itheima.StringDemo;

import java.util.Scanner;

public class StringDemo1 {
    public static void main(String[] args) {
        String s1="hello";
        System.out.println(s1);
        System.out.println(s1.length());
        //双引号给出的字符串对象放支付串常量池，相同内容只放一份
        String s2="hello";
        String s3="hello";
        //放储在堆内存
        String s4=new String("hello");
        System.out.println("============================");
         //简易版本登录
        String username="admin";
        System.out.println("请输入用户名");
        Scanner sc = new Scanner(System.in);
        String name = sc.next();
        //字符串的比较
        if(username.equals(name)){
            System.out.println("用户名正确");
        }else{
            System.out.println("用户名错误");
        }

        System.out.println("============================");

        System.out.println("请输入你的手机号");
        String phone = sc.next();
        System.out.println("系统显示一下手机号进入");
        //186 **** 1443
        String newPhone = phone.substring(0,3)+"****"+phone.substring(7);


    }
}
